<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mmsc - TIFF (Tagged Image File Format ) java imageio reader/writer</title>
<meta name="keywords" content="java, fax, tif, tiff, Tagged Image File Format , jpeg, modified huffman code, baseline bilevel image, class B image, MH, MR, MMR, rfc 2306">
<meta name="description" content="Classes that enable the java imageio system to read and write *.tif (Tagged Image File Format ) files.">
<link rel=StyleSheet href="../../../../../css/general.css" type="text/css" title="mmsc-style" media="screen">
<link rel=StyleSheet href="../../../../../css/print.css" type="text/css" title="mmsc-style" media="print">
</head>
<body>
<div id="container">
<div id="header"><FONT COLOR="#0000ff">m</FONT><FONT COLOR="#ff0000">m</FONT>'<FONT COLOR="#7bc618">s</FONT> <FONT COLOR="#ffff00">c</FONT>omputing</div>
<div id="menu">
<ul>
<li><a href="../../../../../index.html">home</a></li>
<li><a href="../../../../../uk/co/mmscomputing/news/index.html">news</a></li>
<li><a href="../../../../../uk/co/mmscomputing/download/index.html">download</a></li>
<li><a href="../../../../../uk/co/mmscomputing/donation/index.html">donation</a></li>
<li><a href="../../../../../uk/co/mmscomputing/contact/index.html">contact</a></li>
</ul>
</div>
<div id="nav">&nbsp;
<div class="roundrect">
<div class="roundrect-top"><div></div></div>
<div class="roundrect-left"><div class="roundrect-right">
<div class="roundrect-gradient"><b>sub-directories</b></div>
<ul>
<li><a href="../index.html">up</a></li>
</ul>
</div></div>
<div class="roundrect-bottom"><div></div></div>
</div>
</div>
<div id="content">
<div id="abstract">
Classes that enable the java imageio system to read and write *.tif (Tagged Image File Format ) files.
</div>
<div id="desc">
<p>
In order to read/write tiff files with the java imageio classes we need an
ImageWriterSpi, ImageWriter, ImageReaderSpi and ImageReader.
Additional to that we need to tell the java imageio system that we have a new ImageWriterSpi and ImageReaderSpi for it. 
To do this you need to put the file <i>javax.imageio.spi.ImageReaderSpi, javax.imageio.spi.ImageWriterSpi</i> 
into the folder <i>{$your java programs root directory}/META-INF/services/</i> or if those files already exist, 
add the lines <i>uk.co.mmscomputing.imageio.tiff.TIFFImageReaderSpi</i> and <i>uk.co.mmscomputing.imageio.tiff.TIFFImageWriterSpi</i> accordingly.
</p>
<p class="remark">
Motivation to write this class:
<br>The idea was to write a class that can convert sff files into tiff files. 
Therefore I needed this tiff package to show me the results. 
And hence that is why this package is biased towards bilevel tiff images.
</p>

<p class="remark">
   "The ITU-T T.4
   recommendation defines a one-dimensional compression method known as
   Modified Huffman (MH) and a two-dimensional method known as Modified
   READ (MR) (READ is short for Relative Element Address Designate).  In
   1984, a somewhat more efficient compression method known as Modified
   Modified READ (MMR) was defined in the T.6 recommendation.  It was
   originally defined for use with Group 4 facsimile, so that this
   compression method has been commonly called Group 4 compression.  In
   1991, the MMR method was approved for use in Group 3 facsimile and
   has since been widely utilized." [3]
</p>

<ol>
  <li><b>Read</b>
  <br>This tiff package should be able to read every baseline compatible tiff file and more.
  <ol>
    <li>Black & White : no compression, modified huffman, packbits, lzw
    <li>Gray 4 & 8 bit: no compression, packbits, lzw
    <li>Palette Color 4 & 8 bit: no compression, packbits, lzw
    <li>RGB  : 888  images : no compression, packbits, lzw, jpeg(7)
    <li>CMYK : 8888 images : no compression, packbits, lzw
    <li>YCbCr: 888 images  : no compression, packbits, lzw, jpeg(7)
    <li>Fax G3 T.4 MH-Code, MR-Code, G4 T.6 MMR-Code
  </ol>
  <li><b>Write</b>
  <p>
    By default the TIFFImageWriter will save the pictures RGB colour coded.
    <br>If you want to save the images as Fax files you need to supply a TIFFImageWriteParam to the 
    TIFFImageWriter.write... methods.
    <br>The TIFFImageWriteParam object can again call upon a TIFFIIOParamController which 
    will pop up a GUI and enables the user to set certain settings. 
    Have a look at the ...imageviewer.ImageTab.save method.

    <table>
    <tr><th>Photometric Interpretation</th><th>Compression</th><th>SubSampling</th></tr>
    <tr><td>Black-White (WhiteIsZero)</td><td>MH,MR or MMR</td><td>N/A</td></tr>
    <tr><td>RGB</td><td>none, JPEG</td><td>1:1:1</td></tr>
    <tr><td>CMYK</td><td>none</td><td>1:1:1:1</td></tr>
    <tr><td>YCbCr</td><td>none, JPEG</td><td>1:1:1;2:1:1</td></tr>
    </table>

    <p class="remark">
        Using parameters YCbCr,jpeg,2:1:1 and 50% quality is equivalent to the usual jpeg file quality created 
        by many image packages.
    <br>The jpeg encoder uses quantisation values taken from [4] p.143 
        multiplied by 25 and divided by the value of the quality parameter.
    </p>
  </p>
  <li><b>Convert</b>
    <p>How to convert sff files to tif files during fax calls is shown in 
      uk.co.mmscomputing.device.fax.FaxCallSffSaver.
    </p>
    <p>How to convert line by line black&white image data to tiff files is shown in the 
      uk.co.mmscomputing.device.printmonitor package.
    </p>
</ol>
</p>

<p>TIFF stands for <i>Tagged Image File Format</i> and is defined in [2].

<p class="quote">if you need a bit more TIFF have a look at:
<br>[1] <a href="http://java.sun.com/products/java-media/jai/current.html" target="_blank">Java(TM) Image I/O API Download Page</a>
 [last accessed : 2006-08-12]</p>

<p class="quote">[2] Tagged Image File Format Version 6 <a href="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf" target="_blank">TIFF6.pdf</a> 
Adobe [last accessed : 2005-07-30]</p>

<p class="quote">[3] RFC 2306 - Tag Image File Format (TIFF) - F Profile for Facsimile <a href="http://www.faqs.org/rfcs/rfc2306.html" target="_blank">RFC 2306</a> 
 [last accessed : 2005-08-26]</p>

<p class="quote">[4] 'JPEG' : ISO/IEC IS 10918-1, ITU-T Recommendation T.81 <a href="http://www.w3.org/Graphics/JPEG/itu-t81.pdf" target="_blank">ITU-T81</a>
 [last accessed : 2006-01-20]</p>

<!--
Modified Modified Relative element address designate code (MMR)
-->
</div>
<div id="files">
Package : uk.co.mmscomputing.imageio.tiff
<ol>
<li><a href="DE.java">DE.java</a></li>
<li><a href="DEFactory.java">DEFactory.java</a></li>
<li><a href="IFD.java">IFD.java</a></li>
<li><a href="TIFFBaselineFactory.java">TIFFBaselineFactory.java</a></li>
<li><a href="TIFFCMYKInputStream.java">TIFFCMYKInputStream.java</a></li>
<li><a href="TIFFClassBOutputStream.java">TIFFClassBOutputStream.java</a></li>
<li><a href="TIFFClassFFactory.java">TIFFClassFFactory.java</a></li>
<li><a href="TIFFClassFMHOutputStream.java">TIFFClassFMHOutputStream.java</a></li>
<li><a href="TIFFClassFMMROutputStream.java">TIFFClassFMMROutputStream.java</a></li>
<li><a href="TIFFClassFMROutputStream.java">TIFFClassFMROutputStream.java</a></li>
<li><a href="TIFFClassFOutputStream.java">TIFFClassFOutputStream.java</a></li>
<li><a href="TIFFConstants.java">TIFFConstants.java</a></li>
<li><a href="TIFFIIOParamController.java">TIFFIIOParamController.java</a></li>
<li><a href="TIFFImageReader.java">TIFFImageReader.java</a></li>
<li><a href="TIFFImageReaderSpi.java">TIFFImageReaderSpi.java</a></li>
<li><a href="TIFFImageWriteParam.java">TIFFImageWriteParam.java</a></li>
<li><a href="TIFFImageWriter.java">TIFFImageWriter.java</a></li>
<li><a href="TIFFImageWriterSpi.java">TIFFImageWriterSpi.java</a></li>
<li><a href="TIFFSubSamplingInputStream.java">TIFFSubSamplingInputStream.java</a></li>
<li><a href="TIFFSubSamplingOutputStream.java">TIFFSubSamplingOutputStream.java</a></li>
<li><a href="TIFFYCbCrInputStream.java">TIFFYCbCrInputStream.java</a></li>
<li><a href="TIFFYCbCrOutputStream.java">TIFFYCbCrOutputStream.java</a></li>
<li><a href="javax.imageio.spi.ImageReaderSpi">javax.imageio.spi.ImageReaderSpi</a></li>
<li><a href="javax.imageio.spi.ImageWriterSpi">javax.imageio.spi.ImageWriterSpi</a></li>
<li><a href="uk.co.mmscomputing.imageio.tiff.jar">uk.co.mmscomputing.imageio.tiff.jar</a></li>
</ol>
</div>
<div id="dirlist">
</div>
<div id="projects">
Projects :
<ol>
<li><a href="../../../../../uk/co/mmscomputing/application/imageviewer/index.html">uk.co.mmscomputing.application.imageviewer</a>:
<br>A simple Multi Page Image Viewer Applet. To view multipage *.sff, *.tiff and *.gif files. Twain and SANE test application.
</li>
<li><a href="../../../../../uk/co/mmscomputing/device/fax/index.html">uk.co.mmscomputing.device.fax</a>:
<br>mm's computing: Fax System.
</li>
<li><a href="../../../../../uk/co/mmscomputing/device/printmonitor/index.html">uk.co.mmscomputing.device.printmonitor</a>:
<br>Open Source Project - jprintmonitor : A windows print port monitor written (almost only) in java.When used with an adequate printer driver like the <i>mmsc fax printer</i>,allows users to generate sff and tif fax files via the Windows printing system
</li>
<li><a href="../../../../../uk/co/mmscomputing/imageio/jpeg/index.html">uk.co.mmscomputing.imageio.jpeg</a>:
<br>A few jpeg support classes for the tiff package. Compression mode 7.
</li>
<li><a href="../../../../../uk/co/mmscomputing/io/index.html">uk.co.mmscomputing.io</a>:
<br>A few io-stream classes. Modified Huffman (MH), Modified READ (MR), Modified Modified READ (MMR), Base-64, PackBits, Little Endian
</li>
</ol>
</div>
</div>
<div id="fcontainer">
<div id="gnu">
All software on this site is free software; you can redistribute it and/or modify it under the terms of the <a href="http://www.gnu.org/copyleft/lesser.html" target="_blank"> GNU Lesser General Public License </a> as published by the Free Software Foundation
</div>
<div id="footer">
<br><FONT COLOR="#0000ff">m</FONT><FONT COLOR="#ff0000">m</FONT>'<FONT COLOR="#7bc618">s</FONT> <FONT COLOR="#ffff00">c</FONT>omputing<br>2008-07-28
</div>
</div>
</div>
</body>
</html>
